package com.luocj.muke.demo.fragment;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.luocj.muke.demo.R;

public class IndicatorFragment extends Fragment {

    private View inflate;
    private TextView textView;

    public static IndicatorFragment getInstance(String title) {
        Bundle bundle = new Bundle();
        bundle.putString("title", title);

        IndicatorFragment fragment = new IndicatorFragment();
        fragment.setArguments(bundle);
        return fragment;

    }

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        inflate = inflater.inflate(R.layout.fragment_indicator, container, false);
        return inflate;
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        textView = inflate.findViewById(R.id.tv_indicator_title);
        Bundle bundle = getArguments();
        if (bundle != null) {
            String title = bundle.getString("title");
            textView.setText(title);
        }
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }
}
